<?php

namespace pmvc\mvc\controller;

use pmvc\ioc\ObjectFactory;
use pmvc\ioc\InitializingObject;
use Exception;

class ObjectNameControllerMapping 
	implements InitializingObject {

	private $objectFactory;

	public function initialize(ObjectFactory $objectFactory) {
		$this->objectFactory = $objectFactory;
	}

	public function getController($url) {
		try {
			return $this->objectFactory->getObjectByName($url);
		} catch(Exception $e) {
			return NULL;
		}
	}
}


?>
